package com.job.liushuang.HomeWork0714;

import java.util.Random;
import java.util.UUID;

/**
 * @author Liushuang
 * @version 1.0
 * @since 2022-07-14 19:55:53
 */
public class UseRan {
        public static void main(String[] args) {
            Random ran=new Random();
            // for (int i = 0; i <100 ; i++) {
            //   System.out.println(ran.nextInt(100)+1);
            //}
            //给文件起名的时候，如果想要唯一，通常会携带一串16进制32位/36位的数字
            String fileName="面向对象总结.doc";
            for (int i = 1; i <10 ; i++) {
                String uniqueName= UUID.randomUUID().toString()+fileName;
                System.out.println(uniqueName);
            }
            String[] name={"张三","李四","王五","赵六","Lucy","Jack"};
            for (int i = 1; i <5 ; i++) {
                System.out.println("第"+i+"次 幸运者"+name[ran.nextInt(name.length)] );
            }
        }
}

